<ul>
<?php foreach($brands as $brand): ?>
<li>
<?php
            $sname = str_replace(' ', '-', $subcategory_name);
              $sname = mb_strtolower($sname,'UTF-8');
              
              $cname = str_replace(' ', '-', $category_name);
              $cname = mb_strtolower($cname,'UTF-8');
              
              $bname = str_replace(' ', '-', $brand['name']);
              $bname = mb_strtolower($bname,'UTF-8');

?>
<?php $numbers = $this->db->where(array('subcategory_id' => $subcategory_id, 'category_id' => $category_id, 'brand_id' => $brand['brand_id']))->get('products')->num_rows();
              echo anchor('urunler/'.$cname.'/'.$sname.'/'.$bname,$brand['name']." (".$numbers.")"); 
              
              ?>
</li>
<?php endforeach; ?>
</ul>